import { Method } from "axios";
import { Types } from "mongoose";

export let MethodList = ["GET", "DELETE", "HEAD", "OPTIONS", "POST", "PUT", "PATCH", "PURGE", "LINK", "UNLINK"];
MethodList = MethodList.map(item => [item, item.toLocaleLowerCase()]).flat();

export interface Permission {
    _id: Types.ObjectId;
    name: string;
    key: string;
    status: boolean;
    desc: string;
    type: string;
    path: string;
    label: string;
    component: string;
    icon: string;
    method?: Method;
    children: Types.ObjectId[];
    sort: number;
}